<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" 
			content="width=device-width, initial-scale=1.0" />
		<title>xj</title>
		<style type="text/css">
			*{
				margin: 0;
				padding: 0;
				text-align: center;
				box-sizing: border-box;
			}
			a{
				font-size: 50px;
				text-decoration: none;
				color: #222;
				font-family: "楷体";
				line-height: 100vh;
			}

		</style>
	</head>
	<body>
		<a href="">点我获取QQ头像</a>
		<script type="text/javascript">
			var tx = prompt("请输入QQ号获取QQ头像");
			var a = document.querySelector('a');
			a.href = "http://q1.qlogo.cn/g?b=qq&nk="+ tx +"&s=640";
		</script>
	</body>
</html>
